package com.funtester.seven.day2;

public class People {

    public static int total = 0;

    public People() {
    }

    public People(String name, int age) {
        this.name = name;
        this.age = age;
        addPeople();
    }

    public String name;

    public int age;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public void sayHi() {
        System.out.println("你好 ,我是" + this.name);
    }

    /**
     * 人口+1
     */
    public static void addPeople() {
        total++;
    }

    /**
     * 输出人口总数
     */
    public static void printTotal() {
        System.out.println("总人数:" + total);
    }

}
